<template>
  <div>
    <ul v-for="dir in dirs">
      <a :href="getLink(dir)">{{dir}}</a>
    </ul>
  </div>
</template>

<script>
module.exports = {
  props: ['dir'],
  data: function () {
    return {
      dirs: []
    }
  },
  created: function () {
    axios.get('/api/man').then(res => {
      this.dirs = res.data;
    });
  },
  methods: {
    getLink(dir) {
      let strs = dir.split(' ');
      return "/manx?"+"path="+strs[strs.length-1];
    }
  }
}
</script>